import request from '@/utils/request'
import { AxiosPromise } from 'axios'
import { EnumDataVO } from '@/api/system/enum/types'

// 根据字典类型查询字典数据信息
export function getEnums(dictType: string): AxiosPromise<EnumDataVO[]> {
  return request({
    url: '/system/enum/type',
    method: 'post',
    data: dictType,
  })
}

// 查询字典数据列表
export function listData(query: any): AxiosPromise<EnumDataVO[]> {
  return request({
    url: '/system/enum/data/list',
    method: 'post',
    data: query,
  })
}

// 查询字典数据详细
export function getData(dictCode: string | number): AxiosPromise<EnumDataVO> {
  return request({
    url: '/system/enum/data/getDetail',
    method: 'post',
    data: dictCode,
  })
}
